#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int i = 0;
	char arr[31];
	scanf("%c", &arr[i]);
	while (arr[i] != '#')
	{
		i++;
		scanf("%c", &arr[i]);
	}
	arr[i + 1] = '#';
	i = 0;
	while (arr[i] != '#')
	{
		if (arr[i] >= 'A' && arr[i] <= 'Z')
		{
			arr[i] = arr[i] + 32;
		}
		else if (arr[i] >= 'a' && arr[i] <= 'z')
		{
			arr[i] = arr[i] - 32;
		}
		i++;
	}
	i = 0;
	while (arr[i] != '#')
	{
		printf("%c", arr[i]);
		i++;
	}

	return 0;
}